package com.kingtsoft.study.service;

import com.github.pagehelper.PageInfo;
import com.kingtsoft.study.model.StudyHomeworkDetail;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Title:
 * Description:
 * Copyright: Copyright (c) 2017-03-30 下午3:00
 * Company: wondersgroup.com
 *
 * @author jerry.pan(潘健雷)
 * @version 1.0
 */
public interface StudyHomeworkDetailService {

    /**
     * 获取作业
     *
     * @param id 作业主键
     * @return 作业
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    StudyHomeworkDetail load(String id);

    /**
     * 通过老师作业表主键和学生主键获取作业
     *
     * @param homeworkId 老师作业表主键
     * @return 作业
     * @author jerry.pan
     * @date 2017-04-01 12:39:56
     */
    StudyHomeworkDetail loadByHomeworkIdAndStudentId(String homeworkId, String studentId);


    /**
     * 增加作业
     *
     * @param studyHomeworkDetail 作业
     * @author jerry.pan
     * @date 2017-03-31 16:11:29
     */
    StudyHomeworkDetail add(StudyHomeworkDetail studyHomeworkDetail);

    /**
     * 修改作业
     *
     * @param studyHomeworkDetail 作业
     * @author jerry.pan
     * @date 2017-03-31 16:11:29
     */
    StudyHomeworkDetail edit(StudyHomeworkDetail studyHomeworkDetail);

    /**
     * 获取作业的列表
     *
     * @return pageInfo
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    PageInfo<StudyHomeworkDetail> listPage(PageInfo page, StudyHomeworkDetail studyHomeworkDetail);

    /**
     * 获取作业的列表
     *
     * @return list
     * @author jerry.pan
     * @date 2017-03-30 15:08:11
     */
    List<StudyHomeworkDetail> listAll(StudyHomeworkDetail studyHomeworkDetail);


    /**
     * 保存上传文件
     *
     * @param studyHomeworkDetail
     * @author jerry.pan
     * @date 2017-04-01 15:38:22
     */
    StudyHomeworkDetail saveUpload(StudyHomeworkDetail studyHomeworkDetail);


    /**
     * 删除上传文件
     *
     * @param
     * @author jerry.pan
     * @date 2017-04-01 15:38:22
     */
    Map deleteFile(String id);

    /**
     * 查询已经提交的作业
     *
     * @param page
     * @param studyHomeworkDetail
     * @return page info
     * @author jerry.pan
     * @date 2017-04-05 08:40:11
     */
    PageInfo<StudyHomeworkDetail> listCommittedPage(PageInfo page, StudyHomeworkDetail studyHomeworkDetail);
}